First, the command installation
NPM Install react-navigation--save
The library contains three types of components:
(1) Stacknavigator: Used to jump pages and pass parameters
(2) Tabnavigator: Similar to the bottom navigation bar, used to switch different pages on the same screen
(3) Drawernavigator: Side-by-side menu navigation bar for easy setup with drawer screen II, React-navigation 1, stacknavigator property Introduction
Navigationoptions: Confi
The React navigation is returned by default using key as the GoBack parameter, which is generated dynamically rather than the routename we define. There are many ways to change the source code, some say it is integrated redux. How to change the source code I tried too, but if you turn on the swipe back property, it's easy to get stuck. Integrated Redux is a good way, but for the novice redux mode is too complex, and Redux is the power of data flow control, only one because a return to learn a
with drawer navigation
Second, the use of react-navigation
The specific content is broadly divided into the following:
(1) React-navigation Library Property Introduction
(2) Stacknavigator, tabnavigator to achieve the interface between the Jump, tab switch
(3) Stacknavigator interface between the jump, pass value, take value
(4) Drawernavigator implementation Drawer navigation menu
(5) Drawernavigator expansion function
(6) Custom react-navigation
1. Stacknavigator Property Introduction [HTM
How does react-navigation determine whether a user logs on to the logon page,
This article describes how to use react-navigation to determine whether a user is logged on to the logon page, share the information with you, and take notes for yourself, as shown below:
Create an index. js
Import React, {Component} from 'react '; import {AppRegistry, Text, View, Button, Image, StyleSheet, BackHandler, ToastAndroid} from 'react-native'; import {StackNavigator, tabNavigator, NavigationActions} from 're
is active.
The solution is through componentwillreceiveprops,shouldcomponentupdate and Componentdidupdate, When the Params.cateid in Nextprops and the current Params.cateid are different, the render of the page is triggered.
2, realize the gesture swipe right slide back function:Official document Introduction, react-navigation in the root component of the Navigationoptions settings to add gesturesenabled:true, you can implement the slid
Scenario Description:From a component called "My" to enter a list (the contents of this list is webview content), one of the webview can also click into the Details page (also for WebView), but if you do not do any work on the navigation bar, directly click the Back button, Will go directly from the details page to the topmost page, and not return to the list content page; Obviously this is not the effect we want, so we need to add the WebView return event processing in the original navigation r
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.